#===============================================================================
#    RSSGlut id an opensource rss feed reader designed with python. 
#    Copyright (C) 2008  Vijay Kartick
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#===============================================================================

import urllib,os,sys
import rssparser
def secmain():
    print "Running RssGlut without GUI"
    rss_url=raw_input("Enter the url to be parsed")
    getxml(rss_url)
    rssparser.parse("rss.xml")

#reads the xml file and saves it as rss.xml 
def getxml(rss_url):
        file = urllib.urlopen(rss_url)
        text = file.read()
        hdfile=open("rss.xml","w")
        hdfile.write(text)
        hdfile.close()

#runs only if this is not used as a module
if __name__=='__main__':
    secmain()

